@import './variables.scss';
@import './mixins.scss';
@import './element-plus.scss';
@import './common.scss';
@import './layout.scss';
@import './components.scss';

// 全局样式重置
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: $font-family;
  font-size: $font-size-base;
  color: $text-color-primary;
  background-color: $bg-color;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100%;
}

// 链接样式
a {
  color: $primary-color;
  text-decoration: none;
  transition: color 0.3s;

  &:hover {
    color: $primary-color-hover;
  }
}

// 按钮样式
button {
  outline: none;
  border: none;
  background: none;
  cursor: pointer;
}

// 输入框样式
input,
textarea {
  outline: none;
  border: none;
  background: none;
}

// 列表样式
ul,
ol {
  list-style: none;
}

// 图片样式
img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

// 表格样式
table {
  border-collapse: collapse;
  border-spacing: 0;
}

// 滚动条样式
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: $scrollbar-track-color;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: $scrollbar-thumb-color;
  border-radius: 3px;

  &:hover {
    background: $scrollbar-thumb-hover-color;
  }
}

// 选择文本样式
::selection {
  background: $primary-color;
  color: #fff;
}

::-moz-selection {
  background: $primary-color;
  color: #fff;
}

// 工具类
.clearfix {
  @include clearfix;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.pull-left {
  float: left;
}

.pull-right {
  float: right;
}

.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

// 响应式工具类
@media (max-width: 768px) {
  .hidden-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hidden-desktop {
    display: none !important;
  }
}

// 动画类
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-enter-active,
.slide-leave-active {
  transition: transform 0.3s;
}

.slide-enter-from {
  transform: translateX(-100%);
}

.slide-leave-to {
  transform: translateX(100%);
}

// 加载动画
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid $border-color;
  border-top: 2px solid $primary-color;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

// 暗色主题
.dark {
  color-scheme: dark;

  body {
    background-color: $dark-bg-color;
    color: $dark-text-color;
  }

  ::-webkit-scrollbar-track {
    background: $dark-scrollbar-track-color;
  }

  ::-webkit-scrollbar-thumb {
    background: $dark-scrollbar-thumb-color;

    &:hover {
      background: $dark-scrollbar-thumb-hover-color;
    }
  }
}